package perucuy.logic;

import java.lang.reflect.*;
import java.util.*;

import org.apache.log4j.Logger;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
import perucuy.services.AlertaService;

public class ListaAlertaAction extends Action {
    private static Logger log = Logger.getLogger(ListaAlertaAction.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws
            InvocationTargetException, IllegalAccessException {
        AlertaService srvc = new AlertaService();
        //Se procede a obtener el listado de tarea
        List lista = srvc.getAlertas();
        log.debug("Dato de la lista "+lista);
        assert lista != null:"no se obtuvo lista. filtro=";
        if (lista != null && lista.size()>0)request.setAttribute("listadoAlerta", lista);
        return mapping.findForward("success");
    }
}
